﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace DAL
{
    public static class GetCondition
    {
        #region Get Condition

        static testdbsEntities ctx = new testdbsEntities();

        public static List<Condition> GetConditions()
        {
                IQueryable<Condition> tCrew = from cs in ctx.Condition
                                              select cs;
                return tCrew.ToList();
            
        }

        public static List<Condition> GetConditions(Condition mCondition)
        {
                IQueryable<Condition> tCrew = from cs in ctx.Condition
                                              where cs == mCondition
                                              select cs;
                return tCrew.ToList();
            
        }

        public static List<Condition> GetConditionsByWeather(string mWeather)
        {
            
                IQueryable<Condition> tCrew = from cs in ctx.Condition
                                              where cs.weather == mWeather
                                              select cs;
                return tCrew.ToList();
            
        }

        public static List<Condition> GetConditionsByMap(string mMap)
        {
            
            {
                IQueryable<Condition> tCrew = from cs in ctx.Condition
                                              where cs.map == mMap
                                              select cs;
                return tCrew.ToList();
            }
        }



        public static List<Condition> GetConditionByRoute(string mStartPort, string mDestPort)
        {
            
            {
                IQueryable<Condition> tCrew = from cs in ctx.Condition
                                              where cs.srs_port == mStartPort && cs.dest_port == mDestPort
                                              select cs;
                return tCrew.ToList();
            }
        }

        public static List<Condition> GetConditionByPwind(int mPwind)
        {
            
            {
                IQueryable<Condition> tCrew = from cs in ctx.Condition
                                              where cs.pwind == mPwind
                                              select cs;
                return tCrew.ToList();
            }
        }

        #endregion
    }
}
